	
;****************************************************************************************************************
;This code is for a 3 minute on delay timer that is used  on a 3CX1500A7 Linear amp. This delays Plate voltage at
;power turn on. The 3CX1500A7 as well as the 3CX800A7 require a 3 minute warm up before applying plate voltage
;PortB RB0 is used for the output and the clock frequency is 4.0 Mhz. There is a LED tied to RB0 to indicate the
;on state.  After the three minute delay the PIC16F84 causes a small dip relay to close which in turn controls 
;the contactor in the high voltage power supply. Any time power is dropped to the PIC there is a 3 minute delay
;****************************************************************************************************************


; ******************************************************************************************
; * Designer is Pete Juliano. This is a modern day answer to the Amperite Time Delay Relay *
; ******************************************************************************************

						List p=16f84
						Include "p16f84.inc"
						__CONFIG 0x3FF9
		
RB	EQU	0x06
LED	EQU	0x00


COUNT1	EQU	0x18
COUNT2	EQU	0x19
COUNT3	EQU	0x1A


	ORG	0x00
	GOTO	START

;********************Delay Loop 20.02 Sec****************

SEC							;This counter sets up a 20 second delay

		MOVLW	0x85
		MOVWF	COUNT1
L1		MOVLW	0xFD
		MOVWF	COUNT2
L2		MOVLW	0xC5
		MOVWF	COUNT3
L3		DECFSZ	COUNT3,1
		GOTO	L3
		DECFSZ	COUNT2,1
		GOTO	L2
		DECFSZ	COUNT1,1
		GOTO	L1
		MOVLW	0x01
		MOVWF	COUNT1
LP99	DECFSZ	COUNT1,1
		GOTO	LP99
		NOP
		RETURN
;********************************************************
SEC180						;By using the call function a 9 X 20 Second delay is produced = 180 Seconds

		CALL	SEC
		CALL	SEC
		CALL	SEC
		CALL	SEC
		CALL	SEC
		CALL	SEC
		CALL	SEC
		CALL	SEC
		CALL	SEC
		
		RETURN
;************************************************
	


START	

	BSF		3,5
	MOVLW	0x00
	MOVWF	RB
	BCF		3,5

	BSF		RB,LED
	CALL	SEC180
	BCF		RB,LED

LOOP1	CALL	SEC180			;THis keeps the RB0 high forever!
		GOTO	LOOP1

L200	SLEEP
	END

;***Actual time is 180.195 Seconds ~ 3 Minutes ****************
